package com.example.booksystem;

import com.example.booksystem.bean.Book;
import com.example.booksystem.bean.Record;
import com.example.booksystem.bean.Type;
import com.example.booksystem.bean.User;
import com.example.booksystem.dao.BookDao;
import com.example.booksystem.dao.RecordDao;
import com.example.booksystem.dao.TypeDao;
import com.example.booksystem.dao.UserDao;

import java.util.List;

public class Test {
    public static void main(String[] args) {
        /*UserDao userDao = new UserDao();
        User user = userDao.getUser("xhh", "0623");
        System.out.println(user);*/
        /*TypeDao typeDao = new TypeDao();
        List<Type> list = typeDao.getAll();
        System.out.println(list);*/
        /*BookDao bookDao = new BookDao();
        List<Book> booksByTypeId = bookDao.getBooksByTypeId(10);
        System.out.println(booksByTypeId);
        for (int i = 0; i < booksByTypeId.size(); i++) {
            System.out.println(booksByTypeId.get(i));
        }*/
        /*BookDao bookDao = new BookDao();
        List<Book> books = bookDao.getByPage(2, 4);
        for (Book book : books){
            System.out.println(book);
        }*/
        RecordDao recordDao = new RecordDao();
        List<Record> list = recordDao.getRecordByBookId(5);
        for (Record record : list) {
            System.out.println(record);
        }
    }
}
